.class public Lcom/htc/android/footprints/commonui/TBarDrawable;
.super Landroid/graphics/drawable/Drawable;
.source "TBarDrawable.java"


# static fields
.field public static mBoard:Landroid/graphics/drawable/Drawable;

.field public static mSelectedBoard:Landroid/graphics/drawable/Drawable;


# instance fields
.field direct:I

.field private isTransparent:Z

.field private jumpHeight:I

.field private mFocus:Z

.field private mHandler:Landroid/os/Handler;

.field private mPhoto:Landroid/graphics/drawable/Drawable;

.field protected mSelected:Z


# direct methods
.method public constructor <init>(Landroid/graphics/drawable/Drawable;Z)V
    .locals 3
    .parameter "photo"
    .parameter "transparent"

    .prologue
    .line 23
    invoke-direct {p0}, Landroid/graphics/drawable/Drawable;-><init>()V

    .line 60
    const/4 v1, 0x1

    iput v1, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->direct:I

    .line 25
    iput-object p1, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mPhoto:Landroid/graphics/drawable/Drawable;

    .line 26
    sget-object v1, Lcom/htc/android/footprints/commonui/TBarDrawable;->mBoard:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v1}, Landroid/graphics/drawable/Drawable;->copyBounds()Landroid/graphics/Rect;

    move-result-object v1

    invoke-virtual {p0, v1}, Lcom/htc/android/footprints/commonui/TBarDrawable;->setBounds(Landroid/graphics/Rect;)V

    .line 27
    sget-object v1, Lcom/htc/android/footprints/commonui/TBarDrawable;->mBoard:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v1}, Landroid/graphics/drawable/Drawable;->copyBounds()Landroid/graphics/Rect;

    move-result-object v0

    .line 28
    .local v0, r:Landroid/graphics/Rect;
    iget v1, v0, Landroid/graphics/Rect;->left:I

    add-int/lit8 v1, v1, 0x7

    iput v1, v0, Landroid/graphics/Rect;->left:I

    .line 29
    iget v1, v0, Landroid/graphics/Rect;->right:I

    const/16 v2, 0x9

    sub-int/2addr v1, v2

    iput v1, v0, Landroid/graphics/Rect;->right:I

    .line 30
    iget v1, v0, Landroid/graphics/Rect;->top:I

    add-int/lit8 v1, v1, 0x7

    iput v1, v0, Landroid/graphics/Rect;->top:I

    .line 31
    iget v1, v0, Landroid/graphics/Rect;->bottom:I

    const/16 v2, 0x1c

    sub-int/2addr v1, v2

    iput v1, v0, Landroid/graphics/Rect;->bottom:I

    .line 32
    iget-object v1, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mPhoto:Landroid/graphics/drawable/Drawable;

    if-eqz v1, :cond_0

    .line 33
    iget-object v1, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mPhoto:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v1, v0}, Landroid/graphics/drawable/Drawable;->setBounds(Landroid/graphics/Rect;)V

    .line 36
    :cond_0
    iput-boolean p2, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->isTransparent:Z

    .line 37
    return-void
.end method

.method static synthetic access$000(Lcom/htc/android/footprints/commonui/TBarDrawable;)I
    .locals 1
    .parameter "x0"

    .prologue
    .line 14
    iget v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->jumpHeight:I

    return v0
.end method

.method static synthetic access$012(Lcom/htc/android/footprints/commonui/TBarDrawable;I)I
    .locals 1
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 14
    iget v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->jumpHeight:I

    add-int/2addr v0, p1

    iput v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->jumpHeight:I

    return v0
.end method


# virtual methods
.method public draw(Landroid/graphics/Canvas;)V
    .locals 8
    .parameter "canvas"

    .prologue
    .line 90
    invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I

    .line 91
    const/4 v0, 0x0

    iget v1, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->jumpHeight:I

    neg-int v1, v1

    int-to-float v1, v1

    invoke-virtual {p1, v0, v1}, Landroid/graphics/Canvas;->translate(FF)V

    .line 92
    sget-object v0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mBoard:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getBounds()Landroid/graphics/Rect;

    move-result-object v7

    .line 93
    .local v7, r:Landroid/graphics/Rect;
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mPhoto:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getBounds()Landroid/graphics/Rect;

    move-result-object v6

    .line 94
    .local v6, innerR:Landroid/graphics/Rect;
    invoke-virtual {p1}, Landroid/graphics/Canvas;->save()I

    .line 96
    iget v0, v7, Landroid/graphics/Rect;->left:I

    iget v1, v7, Landroid/graphics/Rect;->top:I

    iget v2, v7, Landroid/graphics/Rect;->right:I

    iget v3, v7, Landroid/graphics/Rect;->bottom:I

    invoke-virtual {p1, v0, v1, v2, v3}, Landroid/graphics/Canvas;->clipRect(IIII)Z

    .line 97
    iget-boolean v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->isTransparent:Z

    if-eqz v0, :cond_0

    .line 98
    iget v0, v6, Landroid/graphics/Rect;->left:I

    int-to-float v1, v0

    iget v0, v6, Landroid/graphics/Rect;->top:I

    int-to-float v2, v0

    iget v0, v6, Landroid/graphics/Rect;->right:I

    int-to-float v3, v0

    iget v0, v6, Landroid/graphics/Rect;->bottom:I

    int-to-float v4, v0

    sget-object v5, Landroid/graphics/Region$Op;->DIFFERENCE:Landroid/graphics/Region$Op;

    move-object v0, p1

    invoke-virtual/range {v0 .. v5}, Landroid/graphics/Canvas;->clipRect(FFFFLandroid/graphics/Region$Op;)Z

    .line 101
    :cond_0
    iget-boolean v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mSelected:Z

    if-eqz v0, :cond_1

    .line 102
    sget-object v0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mSelectedBoard:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getCurrent()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 106
    :goto_0
    invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V

    .line 107
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mPhoto:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 108
    invoke-virtual {p1}, Landroid/graphics/Canvas;->restore()V

    .line 109
    return-void

    .line 104
    :cond_1
    sget-object v0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mBoard:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getCurrent()Landroid/graphics/drawable/Drawable;

    move-result-object v0

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    goto :goto_0
.end method

.method public getOpacity()I
    .locals 1

    .prologue
    .line 113
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mPhoto:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0}, Landroid/graphics/drawable/Drawable;->getOpacity()I

    move-result v0

    return v0
.end method

.method public setAlpha(I)V
    .locals 1
    .parameter "i"

    .prologue
    .line 118
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mPhoto:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->setAlpha(I)V

    .line 119
    sget-object v0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mBoard:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->setAlpha(I)V

    .line 120
    return-void
.end method

.method public setColorFilter(Landroid/graphics/ColorFilter;)V
    .locals 1
    .parameter "colorfilter"

    .prologue
    .line 124
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mPhoto:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->setColorFilter(Landroid/graphics/ColorFilter;)V

    .line 125
    sget-object v0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mBoard:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->setColorFilter(Landroid/graphics/ColorFilter;)V

    .line 126
    sget-object v0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mSelectedBoard:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/Drawable;->setColorFilter(Landroid/graphics/ColorFilter;)V

    .line 128
    return-void
.end method

.method public setFocus(ZLcom/google/android/maps/MapView;)V
    .locals 2
    .parameter "focus"
    .parameter "mMap"

    .prologue
    const/4 v1, 0x0

    .line 62
    iput-boolean p1, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mFocus:Z

    .line 63
    iput v1, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->jumpHeight:I

    .line 64
    if-eqz p1, :cond_1

    .line 65
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mHandler:Landroid/os/Handler;

    if-nez v0, :cond_0

    .line 66
    new-instance v0, Lcom/htc/android/footprints/commonui/TBarDrawable$1;

    invoke-direct {v0, p0, p2}, Lcom/htc/android/footprints/commonui/TBarDrawable$1;-><init>(Lcom/htc/android/footprints/commonui/TBarDrawable;Lcom/google/android/maps/MapView;)V

    iput-object v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mHandler:Landroid/os/Handler;

    .line 78
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->sendEmptyMessage(I)Z

    .line 86
    :cond_0
    :goto_0
    return-void

    .line 81
    :cond_1
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mHandler:Landroid/os/Handler;

    if-eqz v0, :cond_0

    .line 82
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V

    .line 83
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mHandler:Landroid/os/Handler;

    goto :goto_0
.end method

.method public setState([I)Z
    .locals 7
    .parameter "stateSet"

    .prologue
    .line 40
    const v3, 0x10100a7

    .line 41
    .local v3, pressed:I
    sget-object v6, Lcom/htc/android/footprints/commonui/TBarDrawable;->mBoard:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v6, p1}, Landroid/graphics/drawable/Drawable;->setState([I)Z

    .line 42
    sget-object v6, Lcom/htc/android/footprints/commonui/TBarDrawable;->mSelectedBoard:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v6, p1}, Landroid/graphics/drawable/Drawable;->setState([I)Z

    .line 43
    iget-object v6, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mPhoto:Landroid/graphics/drawable/Drawable;

    if-eqz v6, :cond_0

    .line 44
    iget-object v6, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mPhoto:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v6, p1}, Landroid/graphics/drawable/Drawable;->setState([I)Z

    .line 47
    :cond_0
    const/4 v5, 0x0

    .line 48
    .local v5, tmpSelected:Z
    move-object v0, p1

    .local v0, arr$:[I
    array-length v2, v0

    .local v2, len$:I
    const/4 v1, 0x0

    .local v1, i$:I
    :goto_0
    if-ge v1, v2, :cond_2

    aget v4, v0, v1

    .line 49
    .local v4, state:I
    if-ne v3, v4, :cond_1

    .line 50
    const/4 v5, 0x1

    .line 48
    :cond_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 53
    .end local v4           #state:I
    :cond_2
    iput-boolean v5, p0, Lcom/htc/android/footprints/commonui/TBarDrawable;->mSelected:Z

    .line 55
    invoke-super {p0, p1}, Landroid/graphics/drawable/Drawable;->setState([I)Z

    move-result v6

    return v6
.end method
